const jwt = require('jsonwebtoekn')

Token = {
    en(str) {
        let tokenKey = jwt.sign(str,'address_token')
        return tokenKey
    },
    de(token){
        try{
            let tokenKey = jwt.verify(token,'address_token')
            return{
                status:'success',
                tokenKey
            }
        }
        catch{
            return{
                status:'faile'
            }
        }
    }
}

module.exports = Token 